package org.nViron.nvSim;

/**
 * Object is the base implementation of a nvVisual, has a unique id and is handled by an object manager
 * @author Roland Haring <p>
 * <script type="text/javascript" src="http://www.ohloh.net/p/376434/widgets/project_basic_stats.js"></script>
 */
public abstract class nvObject implements nvVisual {
    private int         id;
    private nvObjectMgr objectMgr;

    public nvObject(nvObjectMgr objectMgr) {
        this.id        = objectMgr.getNextId();
        this.objectMgr = objectMgr;
        this.objectMgr.addObject(this);
    }

    public int getId() {
        return id;
    }

    public nvObjectMgr getObjectMgr() {
        return objectMgr;
    }

    public void remove() {
        objectMgr.remove(this);
    }
}



